@extends('layouts.app')
@section('content')
   <div class="container">
       <div class="row">
           <div class="col">
               <div class="card">
                   <div class="card-body">

                       <h3>编辑用户资料</h3>
                       @include('common.error')
                       <hr>
                       <form method="POST" action="{{route('users.update',Auth::id())}}" enctype="multipart/form-data">
                           {{csrf_field()}}
                           {{method_field('PUT')}}
                           <div class="form-group">
                               <label for="name">用户名</label>
                               <input type="text" class="form-control" name="name" id="name" placeholder="请填写用户名" value="{{$user->name}}">
                           </div>

                           <div class="form-group">
                               <label for="introduction">简介</label>
                               <textarea type="text" class="form-control" name="introduction" id="introduction" placeholder="请填写个人简介">{{$user->introduction}}</textarea>
                           </div>

                           <div class="form-group">
                               <label for="avatar">头像</label>
                               <input type="file" class="form-control" name="avatar" id="avatar">
                           </div>
                           <button type="submit" class="btn btn-primary float-right">保存</button>
                       </form>
                   </div>
               </div>
           </div>
       </div>
   </div>
@endsection
